<?php


namespace RedMVC\Form\Validator;

/**
 * DateTime class
 *  
 * @category    RedMVC
 * @package     Form
 * @subpackage  Validator 
 * @author      Jan Fischer, bitWorking <info@bitworking.de>
 */
class DateTime extends AValidator{
    public function isValid($value, $formValues = null){
        $value = str_replace('/', '-', $value); // fix engl. format
        if(mb_strlen($value, 'UTF-8') == 1 || !strtotime($value)){
            $this->setError('FORM_VALIDATOR_DATE_TIME');
            return false;
        }
        return true;
    }
}